package com.atguigu.tingshu.order.service.impl;

import com.atguigu.tingshu.model.order.LocalMsg;
import com.atguigu.tingshu.order.mapper.LocalMsgMapper;
import com.atguigu.tingshu.order.service.MqOpsService;
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class MqOpsServiceImpl implements MqOpsService {
    @Autowired
    private LocalMsgMapper localMsgMapper;
    @Override
    public void updateLocalMsg(String orderNo) {
        LambdaUpdateWrapper<LocalMsg> updateWrapper = new LambdaUpdateWrapper<LocalMsg>()
                .eq(LocalMsg::getMsgContent, orderNo)
                .set(LocalMsg::getStatus, 1);
        localMsgMapper.update(null,updateWrapper);
    }
}
